home *** CD-ROM | disk | FTP | other *** search
- Path: ulke.hiMolde.no!ulke!espen
- From: Espen.Berntsen@himolde.no (Nameless)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Referances troubble
- Date: 20 Feb 1996 14:09:59 GMT
- Organization: Molde College, Department of Computer Science
- Message-ID: <1266.6624T117T1455@himolde.no>
- NNTP-Posting-Host: ulke.himolde.no
- X-Newsreader: THOR 2.21 (Amiga;SOUP)
- Originator: espen@ulke
-
- Ok, I have aslight problem with references. The problem is that I have to pass a
- few pointers to a subroutine, where things are done to them, and then they are
- passed back. Now, what I hoped would work was something like this
-
- =========== Cut cut cut ===============================
- #include <stdio.h>
- #include <proto/dos.h>
- #include <proto/exec.h>
- #include <exec/memory.h>
-
- void Tester(void &Testering)
- {
- printf("%i\n",Testering);
- Testering = AllocMem(100, MEMF_CHIP|MEMF_CLEAR);
- printf("%i\n",Testering);
- }
-
- void main(void)
- {
- void *Test;
-
- printf("%i\n",Test);
- Tester(Test);
-
- printf("%i\n",Test);
- // FreeMem(Test, 100);
- }
- ====================== cut cut cut =======================
- Now, this of course don't work. But Ill be damned if I know how to get it to
- work. By reading the test program you should hopefully be able to understand
- what I mean. PLEASE can someone help..
-
- And no, I can't just return the value, 'cause there will be many such values.
- And I don't want to return a structure.
-
-
-
- --
- This excellent message was brought to you at 18-Feb-96 21:29:25 by
-
- Nameless@ask.himolde.no <> Nameless @ IRC <> http://www.himolde.no/~espen
- =============================================================================
- The thoughtless are rarely wordless.
- --
-
- Nameless@ask.hiMolde.no <> irc: Nameless <> http://www.himolde.no/~espen
- ===========================================================================
- Fighting for peace is like fucking for virginity.
-